package com.example.readroomforpaging3.room

import androidx.paging.PagingSource
import androidx.room.Dao
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import com.example.readroomforpaging3.model.Article

@Dao
interface ArticleDao {

    @Query("SELECT * FROM Article")
    fun getArticle(): PagingSource<Int, Article>

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertArticles(articles: List<Article>)

    @Query("DELETE FROM Article")
     suspend fun clearAllArticle()

}